package cz.muni.fi.pa165.dao;

import cz.muni.fi.pa165.entity.Employee;
import java.util.List;
import javax.ejb.Local;

/**
 * This interface specify contract of Employee Data Access Object.
 * 
 * @author <a href="mailto:vramik at redhat.com">Vlastislav Ramik</a>
 */
@Local
public interface EmployeeDAO {
    
    /**
     * Stores new employee into database.
     * 
     * @param employee New employee to add into database.
     * @throws IllegalArgumentException if employee is null, employee's id is not null, any other employee's attribute is null or 
     * empty and if birthDate is not from interval (employee can be from 15 to 99 years old)
     */
    public void createEmployee(Employee employee);
    
    /**
     * Removes employee from database.
     * 
     * @param employee Employee to remove from database.
     * @throws IllegalArgumentException if employee is null, id is null and any employee's attribute is inconsistent with DB 
     * employee's attribute.
     */
    public void removeEmployee(Employee employee);
    
    /**
     * Updates employee in database.
     * 
     * @param employee Employee to update from database.
     * @throws IllegalArgumentException if employee is null, id is null,  any other employee's attribute is null or empty and 
     * if birthDate is not from interval (employee can be from 15 to 99 years old)
     */
    public void updateEmployee(Employee employee);
    
    /**
     * Returns list of all employees.
     * 
     * @return List<Employee> list of all employees
     */
    public List<Employee> getAllEmployees();        
    
    /**
     * Returns employee with given id from database.
     * 
     * @param id employee's id 
     * @return Employee with given id
     */
    public Employee getEmployeeById(Long id);
}
